package gat.api.background.backgroundUser;

import com.bitsun.core.common.persistence.Pager;
import com.bitsun.core.common.web.ResultDTO;

import gat.dto.req.backgroundUser.BackgroundUserReqDto;
import gat.dto.req.backgroundUser.BackgroundUserReqParams;
import gat.dto.res.backgroundUser.BackgroundUserResDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;

/**
 * 
 * @Author: tmac
 * @Email: tmac
 */
@Api(value = "backgroundUser", description = "后台用户接口", tags = {"后台用户"})
public interface BackgroundUserApi {

    /**
     * 创建后台用户
     *
     * @return 返回新创建的资源对象
     */
    @ApiOperation(value = "创建后台用户", tags = {"后台用户"}, nickname = "addBackgroundUser")
    @ApiResponses(value = {@ApiResponse(code = 200, message = "000000:成功，否则失败")})
    ResultDTO<BackgroundUserResDto> addBackgroundUser(BackgroundUserReqDto reqDto);

    /**
     * 查询用户列表
     *
     * @return 返回新创建的资源对象
     */
    @ApiOperation(value = "查询用户列表", tags = {"后台用户"}, nickname = "addBackgroundUser")
    @ApiResponses(value = {@ApiResponse(code = 200, message = "000000:成功，否则失败")})
    ResultDTO<Pager<BackgroundUserResDto>> getBackgroundUserList(BackgroundUserReqParams params);

    /**
     * 用户名密码登录
     *
     * @return 返回新创建的资源对象
     */
    @ApiOperation(value = "用户名密码登录", tags = {"后台用户"}, nickname = "login")
    @ApiResponses(value = {@ApiResponse(code = 200, message = "000000:成功，否则失败")})
    ResultDTO<BackgroundUserResDto> login(BackgroundUserReqParams params);

    /**
     * 手机号验证码登录
     *
     * @return 返回新创建的资源对象
     */
    @ApiOperation(value = "手机号验证码登录", tags = {"后台用户"}, nickname = "login")
    @ApiResponses(value = {@ApiResponse(code = 200, message = "000000:成功，否则失败")})
    ResultDTO<BackgroundUserResDto> loginByPhone(BackgroundUserReqParams params);

    /**
     * 修改密码
     *
     * @return 返回新创建的资源对象
     */
    @ApiOperation(value = "修改密码", tags = {"后台用户"}, nickname = "updatePassword")
    @ApiResponses(value = {@ApiResponse(code = 200, message = "000000:成功，否则失败")})
    ResultDTO<Boolean> updatePassword(BackgroundUserReqParams params);

    /**
     * 重置密码
     *
     * @return 返回新创建的资源对象
     */
    @ApiOperation(value = "重置密码", tags = {"后台用户"}, nickname = "resetPassword")
    @ApiResponses(value = {@ApiResponse(code = 200, message = "000000:成功，否则失败")})
    ResultDTO<Boolean> resetPassword(BackgroundUserReqParams params);
    /**
     * 删除账号
     *
     * @param ids 用英文逗号隔开
     * @return 返回一个空文档
     */
    @ApiOperation(value = "删除账号", tags = {"后台用户",}, nickname = "deleteBackgroundUser")
    @ApiResponses(value = {@ApiResponse(code = 200, message = "操作是否成功,000000:成功，否则失败")})
    ResultDTO<Void> deleteBackgroundUser(String ids);


    /**
     * 查询用户详情
     *
     * @return 返回单独的资源对象
     */
    @ApiOperation(value = "查询用户详情", tags = {"后台用户"}, nickname = "getOneBackgroundUser")
    @ApiResponses(value = {@ApiResponse(code = 200, message = "操作是否成功,000000:成功，否则失败")})
    ResultDTO<BackgroundUserResDto> getOneBackgroundUser(Long id);


    /**
     * 编辑账号信息
     *
     * @return 返回完整的资源对象
     */
    @ApiOperation(value = "编辑账号信息", tags = {"后台用户"}, nickname = "patchUpdateBackgroundUser")
    @ApiResponses(value = {@ApiResponse(code = 200, message = "操作是否成功,000000:成功，否则失败")})
    ResultDTO<BackgroundUserResDto> patchUpdateBackgroundUser(Long id, BackgroundUserReqDto reqDto);

    /**
     * 退出登录
     *
     * @return
     */
    @ApiOperation(value = "退出登录", tags = {"后台用户"}, nickname = "signOut")
    @ApiResponses(value = {@ApiResponse(code = 200, message = "操作是否成功,000000:成功，否则失败")})
    ResultDTO<Void> signOut();

    /**
     * 发送短信验证码
     *
     * @return 返回完整的资源对象
     */
    @ApiOperation(value = "发送短信验证码", tags = {"用户"}, nickname = "sendSMS")
    @ApiResponses(value = {@ApiResponse(code = 200, message = "操作是否成功,000000:成功，否则失败")})
    ResultDTO<Void> sendSMS(String phone);

}
